<?php
class Hqp extends Table
{
	protected $dbname = 'demo';
	protected $table = 't_hqp';
	protected $properties = array('id','name','sex','birthday','status','v_compressed','rt_test1','ra_test2');
	protected $keyProperty = array('id');
	protected $uniqueId = 'id';
	
	function __construct($id=NULL) 
	{
		$this->id = $id;
	}
	
	function _packData()
	{
		if ($this->v_compressed) {
			$head = pack('L',strlen($this->v_compressed));
			$this->v_compressed = $head.gzcompress($this->v_compressed,7);
		}
	}
	
	function _parseData()
	{
		if ($this->v_compressed) {
			$len = unpack('L',substr($this->v_compressed,0,4));
			$this->v_compressed = gzuncompress(substr($this->v_compressed,4),$len[1]);
		}
	}
	
}
?>